package com.commander.spring.cloud.dao.user;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;

import java.util.Date;

/**
 * description:
 * <p>
 * Date: 2020-06-04
 * <p>
 * Time: 19:54
 *
 * @author zhangxin
 */
@TableName("test_user")
@Data
public class UserEntity {
	
	@TableId(type = IdType.UUID)
	private String uuid;
	private String id;
	private String name;
	private String phone;
	private Date birthday;
	@EnumValue
	private Sex sex;
	@Version
	private long version;
	@TableField(updateStrategy = FieldStrategy.NEVER)
	private Date createTime = new Date();
	@TableField(update="now()")
	private Date lastUpdateTime = new Date();
	
	public enum Sex{
		man, woman
	}
}
